package com.zhq.constant;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import androidx.annotation.IntDef;
import androidx.annotation.StringDef;

/**
 * @author ZHQ
 * @create 2019/11/4
 * @Describe APP应用常量
 */
public class AppConstant {


    /***
     * 应用响应状态
     */
    @IntDef({
            HttpResponse.SUCCESS,
            HttpResponse.FILED,
            HttpResponse.TOKEN_EXPIRED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface HttpResponse {

        /**
         * 未处理
         */
        int SUCCESS = 200;
        /**
         * 已处理
         */
        int FILED = -1;
        /**
         * 令牌失效,请重新登录！
         */
        int TOKEN_EXPIRED = 401;
        /**
         * 数据格式返回异常
         */
        int DATA_PARSE_ERROR = 400;
        /**
         * 网络连接超时
         */
        int NETWORK_CONNECT_TIME_OUT = 504;

    }


    /***
     * EventBus状态码管理
     */
    @IntDef({
            EventBusCode.NOTIFICATION_DEVICE_TRANSFORMER_FRAGMENT
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface EventBusCode {

        /**
         * 通知设备fragment页面传参
         */
        int NOTIFICATION_DEVICE_TRANSFORMER_FRAGMENT = 121;

        int REFRESH_TO_COMPLETE = 122;

        int REFRESH_ALARM_TO_COMPLETE = 123;

    }


}
